09. Organizing your files (mkdir, mv)

Organizing your files

With the Shell, you can use commands to organize your files into directories, move files, copy or remove the files.

Use the workspace below the video to practice the commands and remember to practice locally in your computer too.

Ud206 009 Shell P6 - Organizing Your Files

Commands

  • mkdir: Creates directories.
  • mv: Move files from a directory to another.

## Workspace

You can use this workspace to test your commands.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: repl
  • Opened files (when workspace is loaded): n/a

Moving them back

Let's say I change my mind and want to move the epub files back from Documents/Books to Documents. How can I do this? My current working directory is my home directory, and Documents is inside that directory.
Mark each answer that would work:

SOLUTION:
  • `mv Documents/Books/* Documents`
  • `cd Documents; mv Books/*.epub .`
  • `cd Documents/Books; mv * ..`

By the way, when you quote something in the shell, you always use straight quotes. This is what you'll get if you type into a terminal window. However, if you copy and paste from a web page or document, you should be really careful to make sure that it hasn't accidentally been written with “curly quotes”. Curly quotes will not work in the shell.

Single quotes and double quotes do slightly different things in the shell. If you're unsure which to use, go for single quotes.

Recomendation

The Shell commands can be installed or not on your computer if you are using Linux or Mac and you have issues running the commands check the documentation specifically for the Operating System.